package cn.bdqn.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.bdqn.dao.backenduser.BackendDao;
import cn.bdqn.entity.BackendUser;
import cn.bdqn.entity.DevUser;
import cn.bdqn.service.BackendUserService;
@Service
@Transactional
public class BackendUserServiceImpl implements BackendUserService {
	@Autowired
	private BackendDao backendDao;
	@Override
	public BackendUser checkDevUserByUserName(String username,String password) {
		
		BackendUser backendUser = backendDao.checkDevUserByUserName(username);
		if(backendUser == null){
			//用户名不存在
			return null;
		}else{
			//用户名存在
			if(backendUser.getUserpassword().equals(password)){
				//登陆成功
				return backendUser;
			}else{
				//密码错误
				return null;
			}
			
		}
	}

}
